using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.IO;
using System.Diagnostics;
namespace Test {
	class OrdCheck {
		static int Chk(string dgt) {
			int ret=(int.Parse(dgt[0].ToString())*5+int.Parse(dgt[1].ToString())*6+int.Parse(dgt[2].ToString())*7+int.Parse(dgt[3].ToString())*8)%10;
			Debug.Assert(int.Parse(dgt[4].ToString())==ret);
			return ret;
		}
		static void MainX() {
			foreach(string line in File.ReadAllLines("invs.txt"))
				Chk(line);
		}
	}
}
